package com.cjq.bean;

/*前后端交互的数据格式就是这样传*/
public class Message {

    //返回前端看到的是这样的  {status:0,result:"",data:{}}     0表示成功，-1表示失败

    //状态码
    private int status;
    //消息内容
    private String result;
    //消息所携带的一组数据
    private Object data;

    //无参构造方法
    public Message() {
    }

    //全参构造方法
    public Message(int status, String result, Object data) {
        this.status = status;
        this.result = result;
        this.data = data;
    }

    //只包含结果的构造
    public Message(String result) {
        this.result = result;
    }

    //只包含状态码和结果的构造
    public Message(int status, String result) {
        this.status = status;
        this.result = result;
    }

    //只包含状态码
    public Message(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
